package com.xuhai.blog.admin.controller;

import com.xuhai.blog.admin.entity.UserEntity;
import org.apache.shiro.SecurityUtils;

/**
 * @Author PangJunjie
 * @Date 2022/2/9/009
 */
public abstract class AbstractController {
    protected UserEntity getUser(){
        return (UserEntity) SecurityUtils.getSubject().getPrincipal();
    }

    protected Integer getUserId(){
        return getUser()==null?null:getUser().getUserId();
    }
}
